//
// Created by HP on 2025/11/26.
//

#ifndef FLIGHTSERVER_STATIONTRAIN_H
#define FLIGHTSERVER_STATIONTRAIN_H

#include "Model.h"
#include <string>

// 站点与火车关联模型（用于表示某列火车经过哪些站点）
class StationTrain : public Model {
public:
    std::string id;
    std::string station_id;    // 站点ID
    std::string train_id;      // 火车ID
    std::string station_order; // 站点顺序
    std::string arrival_time;  // 到达时间
    std::string departure_time; // 出发时间
    std::string stop_duration; // 停留时长（分钟）
    std::string createdAt;

    StationTrain();

    void bind(const std::string& key, const std::string& value);

    bool save();
    
    // Getter methods
    std::string getId() const { return id; }
    std::string getStationId() const { return station_id; }
    std::string getTrainId() const { return train_id; }
    std::string getStationOrder() const { return station_order; }
    std::string getArrivalTime() const { return arrival_time; }
    std::string getDepartureTime() const { return departure_time; }
    std::string getStopDuration() const { return stop_duration; }
    std::string getCreatedAt() const { return createdAt; }
    
    // Setter methods
    void setId(const std::string& newId) { id = newId; }
    void setStationId(const std::string& newStationId) { station_id = newStationId; }
    void setTrainId(const std::string& newTrainId) { train_id = newTrainId; }
    void setStationOrder(const std::string& newOrder) { station_order = newOrder; }
    void setArrivalTime(const std::string& newArrivalTime) { arrival_time = newArrivalTime; }
    void setDepartureTime(const std::string& newDepartureTime) { departure_time = newDepartureTime; }
    void setStopDuration(const std::string& newDuration) { stop_duration = newDuration; }
};

#endif //FLIGHTSERVER_STATIONTRAIN_H
